#include "Logger.h"
#include "LogConsoleRecorder.h"
#include "ThreadPool/ThreadPool.h"
#include "TaskTest.h"
#include <iostream>


int main(int argc, char** argv)
{
	LOGGER.addLogRecorder(std::make_shared<LogConsoleRecorder>());
	THREADPOOL.init(10);
	if (!THREADPOOL.start())
	{
		return -1;
	}
	THREADPOOL.addTask(std::make_shared<TaskTest>());
	THREADPOOL.addTask(std::make_shared<TaskTest>());
	THREADPOOL.addTask(std::make_shared<TaskTest>());
	std::this_thread::sleep_for(std::chrono::milliseconds(200));
	INFOLOGGER("Started TaskThread Count:%d\n", THREADPOOL.getTaskCount());

	std::this_thread::sleep_for(std::chrono::seconds(2));
	THREADPOOL.stop();
	INFOLOGGER("Started TaskThread Count:%d\n", THREADPOOL.getTaskCount());
	getchar();
	LOGGER.stop();
	return 0;
}